import React from 'react';
import path from 'path'
import { BrowserRouter as Router, Route, Redirect, Link } from 'react-router-dom';

export default class Login extends React.Component {
    constructor(props) {
        super(props);
        var searchObj = function searchObj(search) {
            return JSON.parse("{\"".concat(decodeURIComponent(search.substring(1)).replace(/&/g, '","').replace(/=/g, '":"'), "\"}"));
        };
        var location = searchObj(props.location.search);
        sessionStorage.setItem('userOpenid', JSON.stringify(location));
    }

    render() {
        return <Router path="/login">
            {window.open(`/foodbever/wechat/authorize${this.props.location.search}`, "_self")}
        </Router>
    }
}